import controRoute from "../../route/RouterHandler";
import { ctx } from "../inter";
export = async function(ctx:any,err:Error) {
    return new Promise((reserved,callerr)=>{
        let _500:routeInterface = controRoute.getSpecialRoute("500") as routeInterface;
        error(_500,ctx,err).then(e=>{
            reserved(e)
        }).catch(err=>{
            callerr({code:500,message:err.toString()})
        })
    })
}
async function error(route:routeInterface,ctx:ctx,err:Error){
    // 执行到这里开始执行控制器
    return await route.controller.module.run(ctx,err)
}